<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>小DEMO</title>
</head>

<body>
  <label>用户名:</label><input type="input" name="username" placeholder="请输入用户名：" />
  <label>密码:</label><input type="input" name="password" placeholder="请输入密码：" />
  <input type="button" name="submit" value="按钮" onclick="onclickButton();">
</body>

</html>

<table>
  <li id="lilist">

  </li>
</table>
<script type="text/javascript">
  function onclickButton() {
    var username = document.getElementsByName("username")[0].value;
    var password = document.getElementsByName("password")[0].value;
    var dom = document.getElementById("lilist");
    var newOl = document.createElement("ol"); //创建新元素ol
    var newText = document.createTextNode("用户名：" + username + ";密码：" + password); //创建新文本
    newOl.appendChild(newText);
    dom.appendChild(newOl);
  }
</script>